package com.tongji.housediy.view
{
	import com.tongji.housediy.events.commonEvent.RoomNameAdminEvent;
	import com.tongji.housediy.events.commonEvent.ShowHideTitleWindowEvent;
	import com.tongji.housediy.model.BrandModel;
	import com.tongji.housediy.model.CompEnableStateModel;
	import com.tongji.housediy.utils.DragDropManager;
	import com.tongji.housediy.view.components.CommonWindow;
	import com.tongji.housediy.view.components.DoubleDoor;
	import com.tongji.housediy.view.components.DoubleShiftDoor;
	import com.tongji.housediy.view.components.DoubleWindow;
	import com.tongji.housediy.view.components.FixedWindow;
	import com.tongji.housediy.view.components.Furniture;
	import com.tongji.housediy.view.components.ShiftDoor;
	import com.tongji.housediy.view.components.SingleDoor;
	
	import flash.events.MouseEvent;
	
	import mx.binding.utils.BindingUtils;
	import mx.controls.Alert;
	
	import org.robotlegs.mvcs.Mediator;
	
	public class BrandDetailViewMediator extends Mediator
	{
		[Inject]
		public var view:BrandDetailView;
		
		[Inject]
		public var enableModel:CompEnableStateModel;
		
		[Inject]
		public var brandModel:BrandModel;
		
		override public function onRegister():void
		{
			view.backBtn.addEventListener(MouseEvent.CLICK, backToMainHandler);
			view.goodsTotal.text = "该品牌共" + brandModel.total + "个产品";
			BindingUtils.bindProperty(view.goodsList.bigList.dataGroup, "dataProvider", brandModel, "goodsList");			
		}
			
		private function backToMainHandler(event:MouseEvent):void
		{
			enableModel.stateIndex = 0;
		}
	}
}